﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using System.Web.Security;

namespace Camalot.Common.Membership {
	class DataContextInitializer : DropCreateDatabaseIfModelChanges<DataContext> {
		protected override void Seed ( DataContext context ) {
			MembershipCreateStatus Status;
			System.Web.Security.Membership.CreateUser ( "admin", "admin", "admin@example.com", null, null, true, out Status );
			Roles.CreateRole ( "Administrators" );
			Roles.CreateRole ( "User" );
			Roles.AddUserToRole ( "admin", "Administrators" );
		}
	}
}
